<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/EmptyPHPWebPage.php to edit this template
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        
    </head>
    <body>
        <?php
        if($_GET["id"]){
            $uid=(int)$_GET["id"];
            if($uid){
        // put your code here
            $hostname="127.0.0.1";
            $username="root";
            $password="123456";
            $database="add";
            $link=mysqli_connect($hostname, $username, $password, $database);
            mysqli_set_charset($link, "utf-8");
            if($link){
                 $sql="delete from user where uid=${uid}";
                 $result=mysqli_query($link,$sql);
                 if($result){
                    echo "<script>alert('成功删除');"
                .   "location='index.php'</script>";
                }else{
                    echo "删除失败！";   
                    }
            }
            }
        }else{
                echo "参数错误";
            }
        ?>
    </body>
    
</html>
